package com.kern.jpademo.entity;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by caoshi at 23:02 2021-07-31
 */
@Data
@Entity
@Table(name = "t_book")
public class XBook {

    @Id
    @Column(name = "id")
    private String id;

    @Column(name = "name")
    private String name;

    @Column(name = "publish_date")
    private Date publishDate;

    @Column(name = "price")
    private Double price;

    @Column(name = "author_id", insertable = false, updatable = false)
    private String authorId;


    public XBook() {
    }

    public XBook(String id, String name, Date publishDate, Double price, String authorId) {
        this.id = id;
        this.name = name;
        this.publishDate = publishDate;
        this.price = price;
        this.authorId = authorId;
    }
}
